Skip to content

Conversation

avalonche
Copy link
Collaborator

πŸ“ Summary

Add test utils for deploying flashtestation contracts (using the mock quote contract) and integration tests.

πŸ’‘ Motivation and Context


βœ… I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

@avalonche avalonche force-pushed the add-flashtestation-builder-tx branch from 46380ae to 41c42bf Compare October 1, 2025 22:41
@avalonche avalonche force-pushed the add-flashtestation-integration-tests branch 2 times, most recently from c5355b4 to a84c2bc Compare October 2, 2025 03:02
@avalonche avalonche force-pushed the add-flashtestation-builder-tx branch from 41c42bf to 01573b2 Compare October 2, 2025 05:45
@avalonche avalonche force-pushed the add-flashtestation-integration-tests branch from a84c2bc to 3757a28 Compare October 2, 2025 05:45
@avalonche avalonche force-pushed the add-flashtestation-builder-tx branch from 01573b2 to 32146ac Compare October 2, 2025 17:48
@avalonche avalonche force-pushed the add-flashtestation-integration-tests branch from 3757a28 to 525f5da Compare October 2, 2025 17:49
@avalonche avalonche force-pushed the add-flashtestation-builder-tx branch from 32146ac to 2499332 Compare October 3, 2025 17:54
@avalonche avalonche force-pushed the add-flashtestation-integration-tests branch from 3997fe0 to 260cb95 Compare October 3, 2025 21:27
@avalonche avalonche force-pushed the add-flashtestation-builder-tx branch from 11f6b6a to 5787983 Compare October 16, 2025 18:00
Base automatically changed from add-flashtestation-builder-tx to main October 16, 2025 18:16
@Copilot Copilot AI review requested due to automatic review settings October 16, 2025 18:21
@avalonche avalonche force-pushed the add-flashtestation-integration-tests branch from 260cb95 to 2bd3b66 Compare October 16, 2025 18:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds full flashtestations integration support: contract deployment utilities, builder transaction logic (funding, registration, block proof), an in-test attestation server, and end-to-end integration tests. Also broadens the payload builder context API and introduces new test constants/signers.

  • Introduces FlashtestationsBuilderTx with registration and block proof flows.
  • Adds integration tests covering registration, block proofs, and interaction with flashblock number contract.
  • Expands OpPayloadBuilderCtx method visibility and adds an in-process mock attestation HTTP server for tests.

Reviewed Changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 20 comments.

Show a summary per file
File Description
crates/op-rbuilder/src/tests/mod.rs Registers new flashtestations test module and adds test addresses.
crates/op-rbuilder/src/tests/framework/utils.rs Adds deployment/init helpers, workload addition, signer selection adjustments, and fixes a typo in a method name.
crates/op-rbuilder/src/tests/framework/mod.rs Adds new signer keys and flashtestations constants.
crates/op-rbuilder/src/tests/framework/instance.rs Adds mock attestation server lifecycle and accessors.
crates/op-rbuilder/src/tests/framework/artifacts/genesis.json.tmpl Funds additional test accounts.
crates/op-rbuilder/src/tests/flashtestations.rs New integration tests for registration, block proofs, and number contract interaction.
crates/op-rbuilder/src/tests/flashblocks.rs Switches to shared FLASHBLOCKS_NUMBER_ADDRESS constant and removes unused imports.
crates/op-rbuilder/src/flashtestations/service.rs Refactors service to use new builder_tx module and passes builder policy address.
crates/op-rbuilder/src/flashtestations/mod.rs Adds LogMismatch revert reason and exports builder_tx module.
crates/op-rbuilder/src/flashtestations/builder_tx.rs Implements Flashtestations builder transaction logic (funding, registration, block proof).
crates/op-rbuilder/src/flashtestations/attestation.rs Improves log message clarity for remote quote fetching.
crates/op-rbuilder/src/builders/standard/builder_tx.rs Updates import path for FlashtestationsBuilderTx.
crates/op-rbuilder/src/builders/flashblocks/builder_tx.rs Uses new BuilderTransactionError::other helper for clearer error construction.
crates/op-rbuilder/src/builders/context.rs Makes previously module-private builder context accessors public.
crates/op-rbuilder/src/builders/builder_tx.rs Adds helper constructor for Other variant of BuilderTransactionError.
crates/op-rbuilder/Cargo.toml Adds HTTP server dependencies for testing profile.
README.md Updates flashtestations run example flags.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +583 to +589
impl Drop for AttestationServer {
fn drop(&mut self) {
if let Some(tx) = self.shutdown_tx.take() {
let _ = tx.send(());
}
tracing::info!("AttestationServer dropped, terminating server");
}
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping only signals shutdown without awaiting the server task; the listener may still accept connections briefly, leading to potential race conditions or port reuse issues. Consider storing the JoinHandle and awaiting it in an async shutdown path or joining in a separate background task to ensure orderly termination.

Copilot uses AI. Check for mistakes.

@avalonche avalonche enabled auto-merge (squash) October 16, 2025 18:25
@avalonche avalonche merged commit 012577e into main Oct 16, 2025
4 checks passed
@avalonche avalonche deleted the add-flashtestation-integration-tests branch October 16, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants